
/**
  ******************************************************************************
  * Copyright 2021 The Microbee Authors. All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * 
  * @file       plane.c
  * @author     baiyang
  * @date       2023-6-29
  ******************************************************************************
  */

/*----------------------------------include-----------------------------------*/
#include <stdint.h>

#include <rtthread.h>

#include <plane/fms.h>
#include <plane/mms.h>
#include <plane/ahrs.h>
#include <plane/gcs_plane.h>
#include <common/microbee.h>
#include <logger/task_logger.h>
#include <board_config/board_config.h>
/*-----------------------------------macro------------------------------------*/

/*----------------------------------typedef-----------------------------------*/

/*---------------------------------prototype----------------------------------*/

/*----------------------------------variable----------------------------------*/

/*-------------------------------------os-------------------------------------*/

/*----------------------------------function----------------------------------*/
int plane_main(void)
{
    task_gcs_init();
    task_logger_init();
#if defined(GP_USING_EKF)
    task_ahrs_nav_init();
#endif
    task_mms_init();
    task_fms_init();

    // 设置旋翼初始化完成标志
    brd_set_vehicle_init_finish();

    return 1;
}

#if CONFIG_HAL_BOARD == HAL_BOARD_RTTHREAD
MB_INIT_BOARD_EXPORT(brd_init);
MB_INIT_APP_EXPORT(plane_main);
#endif
/*------------------------------------test------------------------------------*/


